package File_sttudy;

import java.io.File;

public class File2 {
    public static void main(String[] args) {
        File f1 = new File("a.txt");
        //传递文件路径的字符串
        System.out.println(f1);
        //a.txt
        File f2 = new File("C:\\","a.txt");
        //C:\a.txt
        //前面的是父路径，后面的是子路径
        System.out.println(f2);
        File parent = new File("c:\\");
        File f3 = new File(parent,"c.txt");
        System.out.println(f3);
        //c:\c.txt

    }
}
